<div class="full_w">
    <div class="h_title"><?php echo Yii::t('AdmincpModule.admincp', 'Media'); ?></div>
    <h2>Media</h2>
    <p>Media consists of the images, video, recordings, and files that you upload and use in your blog. Media is typically uploaded and inserted into the content when writing a Post or writing a Page</p>
    <div class="entry">
        <div class="sep"></div>
    </div>
    <table>
        <thead>
            <tr>
            	<th scope="col" class="chb"><input type="checkbox" onclick="selectAll(this);"></th>
                <th scope="col"><?php  echo Yii::t('AdmincpModule.admincp', 'File');?></th>
                <th scope="col"><?php  echo Yii::t('AdmincpModule.admincp', 'Title');?></th>
                <th scope="col"><?php  echo Yii::t('AdmincpModule.admincp', 'Date');?></th>
                <th scope="col"><?php  echo Yii::t('AdmincpModule.admincp', 'Author');?></th>
                <th scope="col"><?php  echo Yii::t('AdmincpModule.admincp', 'Status');?></th>
                <th scope="col" style="width: 65px;"><?php  echo Yii::t('AdmincpModule.admincp', 'Options');?></th>
            </tr>
        </thead>
            
        <tbody>
        
        <?php if(!empty($arrMedia)):?>
			<?php foreach($arrMedia as $i=>$R):?>
            <tr>
                <td class="align-center"><input type="checkbox"></td>
				<td>
					<?php if(in_array($R['media_file_extension'], array('jpg', 'jpeg', 'png', 'gif', 'bmp'))): ?>
					<img class="lazy" src="img/grey.gif" data-original="<?php echo UPLOADS_URL.'/'.$R['media_file']; ?>" style="max-width:100px; max-height:100px;">
					<?php elseif(in_array($R['media_file_extension'], array('swf'))): ?>
					<object width="100" height="100" data="<?php echo UPLOADS_URL.'/'.$R['media_file']; ?>"></object> 
					<?php else: ?>
					<img class="lazy" src="img/grey.gif" data-original="img/icons/file.png" />
					<?php endif; ?>
				</td>
                <td><?php echo $R['media_title']; ?></td>
				<td></td>
                <td></td>
                <td><?php echo $R['media_status']; ?></td>
                <td>
                    <a href="<?php echo LINK_ADMINCP_ARTICLES.'/form/?id='.$R['media_id']; ?>" class="table-icon edit" title="Edit"></a>
                    <a href="<?php echo LINK_ADMINCP_ARTICLES.'/view/?id='.$R['media_id']; ?>" class="table-icon archive" title="Archive"></a>
                    <a href="<?php echo LINK_ADMINCP_ARTICLES.'/delete/?id='.$R['media_id']; ?>" class="table-icon delete" title="Delete"></a>
                </td>
            </tr>
            <?php endforeach; ?>
		<?php else: ?>
            <tr>
                <td colspan="7">No data found!</td>
            </tr>
        <?php endif; ?>
        </tbody>
    </table>
    <div class="entry">
        <?php $this->widget('Pagination', array(
			'pages' => $objPages,
		)) ?>
        <div class="sep"></div>		
        <a class="button add" href="<?php echo LINK_ADMINCP_MEDIA.'/form'; ?>"><?php echo Yii::t('AdmincpModule.admincp', 'Add New'); ?></a> <a class="button" href="">Categories</a> 
    </div>
</div>
<script type="text/javascript" src="../libs/jquery/lazyload/jquery.lazyload.min.js"></script>
<script type="text/javascript">
$(function(){
	$("img.lazy").lazyload({
		failure_limit : 200,
		skip_invisible : false,
		effect : "fadeIn"
	}).removeClass("lazy");
});
</script>